#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <vector>
#include <iterator>
#include <functional>
#include <boost/bind.hpp>
#include <boost/timer.hpp>
#include <boost/multi_array.hpp>
#include <boost/shared_ptr.hpp>

using namespace std;

int main(int argc, char **argv)
{
	typedef boost::multi_array<int, 2> MATRIX;
	typedef MATRIX::index Index;

	int a,b;
	cin>>a>>b;

	MATRIX metrix( boost::extents[a][b] );
	for(Index i=0;i<a;++i)
	  for(Index j=0;j<b;++j)
		  metrix[i][j] = rand()% (a*b);

	for(Index i=0;i<a;++i)
	{
	  for(Index j=0;j<b;++j)
		  cout<<setfill('_')<<setw(5)<<metrix[i][j]<<"  ";
	  cout<<endl;
	}
	return 0;
}
